package club.beimeng.service.impl;

import club.beimeng.entity.Book;
import club.beimeng.mapper.BookMapper;
import club.beimeng.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    @Override
    public int addBook(Book book) {
        return bookMapper.addBook(book);
    }

    @Override
    public int deleteBookById(int book_id) {
        return bookMapper.deleteBookById(book_id);
    }

    @Override
    public int updateBookById(Book book) {
        return bookMapper.updateBookById(book);
    }

    @Override
    public Book getBookById(int book_id) {
        return bookMapper.getBookById(book_id);
    }

    @Override
    public List<Book> getAllBooks() {
        return bookMapper.getAllBooks();
    }
}
